var util= require('util');

var OAuth= require('oauth').OAuth;

var oa= new OAuth("https://api.twitter.com/oauth/request_token",
                  "https://api.twitter.com/oauth/access_token",
                  "uD1gI1xqoMwh7PiuIvMVDg",
                  "QgAyUxndTbZZ0SlLOSTSVF4SjExLXZELCUwHz8BrQ",
                  "1.0",
                  null,
                  "HMAC-SHA1");

oauth_token = 'mc157dCiBRJp6yLc1GBeJilz4uwSjMszQfIiYyImQ';
oauth_token_secret = 'nvdI8Tql4EdcudWlhUbX2ZQKR55Gd2wRz8O6LVeI5A';

oa.getOAuthAccessToken(oauth_token, oauth_token_secret, function(error, oauth_access_token, oauth_access_token_secret, results2) {
    util.puts('oauth_access_token: ' + oauth_access_token);
    util.puts('oauth_access_token_secret: ' + oauth_access_token_secret);
    util.puts('accesstoken results: ' + util.inspect(results2));
    
//    oa.getProtectedResource("http://term.ie/oauth/example/echo_api.php?foo=bar&too=roo", "GET", oauth_access_token, oauth_access_token_secret,  function (error, data, response) {
//        util.puts(data);
//    });
  });

